package edu.pku.sei.gefcommon.descriptor.core;

import java.util.List;

import org.eclipse.ui.views.properties.IPropertyDescriptor;

class PropertyItemTable {
	public Class type;
	public List<PropertyItem> item;
	public IPropertyDescriptor[] descriptors;
	
	public void AddPropertyItem(PropertyItem it){
		int i,s=item.size();
		for(i=0;i<s;i++){
			PropertyItem pi = item.get(i);
			if(pi.equals(it)) {
				item.set(i, it);
				return;
			}
		}
		item.add(it);
	}
	public PropertyItem getItemById(Object id){
		if (item != null) {
			for (PropertyItem it : item) {
				if (it.id == id)
					return it;
			}
		}
		return null;
	}

}
